CREATE EXTERNAL TABLE IF NOT EXISTS spmi_ods.spmi_receipt_msg_err_log(
id                                                 bigint                         COMMENT '主键ID',
waybill_no                                         String                         COMMENT '原运单编号',
receipt_no                                         String                         COMMENT '回单编号，取自运单表中的回单号',
body                                               String                         COMMENT '消息体',
msg_type                                           smallint                       COMMENT '消息类型:(0:未知类型, 1:回单揽收, 2:回单签收, 3:算费)',
msg_status                                         smallint                       COMMENT '消息状态:(1:未处理, 2:已处理, 3:作废)',
error_msg                                          String                         COMMENT '错误信息',
fee_type_id                                        bigint                         COMMENT '账单费用类型ID',
fee_type_code                                      String                         COMMENT '账单费用类型CODE',
preprocess_info                                    String                         COMMENT '预处理结果',
preprocess_time                                    timestamp                      COMMENT '处理时间',
preprocess_count                                   bigint                         COMMENT '处理次数',
trace_id                                           String                         COMMENT '链路日志ID',
create_time                                        timestamp                      COMMENT '创建时间'
)
COMMENT '回单账单错误日志表'
PARTITIONED BY (dt STRING COMMENT '更新/创建日期 (yyyy-MM-dd)')
STORED AS PARQUET
LOCATION '/dw/hive/spmi_ods.db/external/spmi_receipt_msg_err_log'
TBLPROPERTIES (
  'parquet.column.index.access'='true'
);